import { connect } from 'react-redux'
import { add, minus } from '../store/actions'
function About(props) {
  return <div className='about_box'>
    关于页
    <h1>数字是{props.count} 类型是{props.type}</h1>
    <button onClick={props.add.bind(null, 5)}>+</button>
    <button onClick={props.minus.bind(null, 10)}>-</button>
  </div>
}
About = connect((state) => {
  return {
    count: state.CounteReducer.count,
    type: state.CounteReducer.type
  }
}, (dispatch) => {
  return {
    add(n) {
      dispatch(add(n))
    },
    minus(n) {
      dispatch(minus(n))
    }
  }
})(About)

export default About